-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Remove GBR from the account settings on initial signup. #49004
fix: Remove GBR from the account settings on initial signup. #49004
Conversation
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
@marcochavezf Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
Sorry @marcochavezf for the bump, I mistakenly added wrong url in in the fixed issue section. @ntdiary will be the reviewer here. |
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
I'll review this PR in about 12 hours, as there is another higher-priority pr that needs to be reviewed first. :) |
@@ -40,16 +40,21 @@ function ContactMethodsPage({loginList, session, route}: ContactMethodsPageProps | |||
const loginNames = Object.keys(loginList ?? {}); | |||
const navigateBackTo = route?.params?.backTo; | |||
|
|||
const filteredLoginNames = loginNames.filter((loginName) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is filter needed here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to filter out the temporary validation email to avoid showing the GBR when there is only one contact method. For example, when logging in with a phone number and adding a new contact method, the default contact method is added without the SMS domain.
Monosnap.screencast.2024-09-15.17-47-33.mp4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your detailed explanation! I just asked in another PR whether this behavior is normal. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ntdiary, can you please re-test these, I have made the necessary changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
src/libs/UserUtils.ts
Outdated
return login.partnerUserID || pendingAction; | ||
}); | ||
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing | ||
return !Object.values(filteredLoginList ?? {}).every((field) => field.validatedDate || currentUserLogin === field.partnerUserID); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the above filter is necessary, then filteredLoginList
will be an array, so Object.values
isn't needed. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
Hi, @Krishna2323 @ntdiary any updates here? Are we blocked on something here? |
@techievivek, not a major issue. The current PR adds a filter function compared to the original proposal, because when a user adds a new contact method, another PR accidentally added an extra entry to the |
@ntdiary @Krishna2323, can we look into this now? Given the other PR is merged. |
Thanks for the update @techievivek, I will provide updates on this today. |
More conflicts 🏃 |
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some minor suggestions. :)
} else if (!login?.validatedDate) { | ||
} else if (!login?.validatedDate && !isDefaultContactMethod) { | ||
indicator = CONST.BRICK_ROAD_INDICATOR_STATUS.INFO; | ||
} else if (!login?.validatedDate && isDefaultContactMethod && filteredLoginNames.length > 1) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I remember correctly, if the user actively adds a second contact method, we can display GBR on the unverified primary login method. So, I think using loginNames.length
here should suffice, and we can remove filteredLoginNames
.
BTW, so far, to add a second contact method, we need to enter the verification code sent to our primary contact method, I personally think this effectively verifies the primary login method. However, it's clear that the backend doesn't have this logic yet, mabe we can discuss it in a separate issue. :)
cc @techievivek
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I remember correctly, if the user actively adds a second contact method, we can display GBR on the unverified primary login method. So, I think using
loginNames.length
here should suffice, and we can removefilteredLoginNames
.
@Krishna2323, any different thoughts about this suggestion? 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BTW, so far, to add a second contact method, we need to enter the verification code sent to our primary contact method, I personally think this effectively verifies the primary login method. However, it's clear that the backend doesn't have this logic yet, mabe we can discuss it in a separate issue. :)
Aaah, good call, I think all this are showing up after we introduce unvalidated signups to our platform. I agree we an improve here. I will create an internal GH to work on this, thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any different thoughts about this suggestion? 😄
No, I agree with that, will update that today.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ntdiary, sorry for delay, I have updated the code to show GRB on the default contact when we have more than 2 logins in the list.
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
Reviewer Checklist
Screenshots/VideosAndroid: Native49004-android-native.mp4Android: mWeb Chrome49004-android-web.mp4iOS: Native49004-ios-native.mp4iOS: mWeb Safari49004-ios-safari.mp4MacOS: Chrome / Safari49004-web.mp4MacOS: Desktop49004-desktop.mp4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. :)
BTW, @Krishna2323, I encountered a strange problem on the Android web (1 time), the contact methods page didn’t display the primary contact method, but I couldn’t reproduce it in subsequent new tests, not sure if you can reproduce it. 😂 49004-android-web-problem.mp4 |
Just to add, I checked the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the changes.
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
Performance Comparison Report 📊Significant Changes To Duration
Show details
Meaningless Changes To DurationShow entries
Show details
|
@Expensify/mobile-deployers 📣 Please look into this performance regression as it's a deploy blocker. |
This PR won't impact performance. |
Yeah, I can't see any correlation on why it would impact |
🚀 Deployed to staging by https://github.com/techievivek in version: 9.0.56-0 🚀
|
🚀 Deployed to production by https://github.com/Julesssss in version: 9.0.56-9 🚀
|
Details
Fixed Issues
$ #47863
PROPOSAL: #47863 (comment)
Tests
Profile
tab in the Account section/settings/profile
> Verify GBR is not shown onContact method
field in thepublic profile
detail sectionContact method
> Verify GBR is not shown on the default contact methodNew contact method
> Enter email > ClickAdd
contact-methods
page and verify GBR is shown on the default contact methodProfile
tab in the Account section &Contact method
field in thepublic profile
detail section.Offline tests
Profile
tab in the Account section/settings/profile
> Verify GBR is not shown onContact method
field in thepublic profile
detail sectionContact method
> Verify GBR is not shown on the default contact methodNew contact method
> Enter email > ClickAdd
contact-methods
page and verify GBR is shown on the default contact methodProfile
tab in the Account section &Contact method
field in thepublic profile
detail section.QA Steps
Profile
tab in the Account section/settings/profile
> Verify GBR is not shown onContact method
field in thepublic profile
detail sectionContact method
> Verify GBR is not shown on the default contact methodNew contact method
> Enter email > ClickAdd
contact-methods
page and verify GBR is shown on the default contact methodProfile
tab in the Account section &Contact method
field in thepublic profile
detail section.PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label and/or tagged@Expensify/design
so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
android_native.mp4
Android: mWeb Chrome
android_chrome.mp4
iOS: Native
ios_native.mp4
iOS: mWeb Safari
ios_safari.mp4
MacOS: Chrome / Safari
web_chrome.mp4
MacOS: Desktop
desktop_app.mp4